<?php /* Smarty version 2.6.20, created on 2016-04-11 20:00:03
         compiled from ./purchases/create.php */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('block', 'shops', './purchases/create.php', 17, false),array('block', 'classes', './purchases/create.php', 24, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/top.php", 'smarty_include_vars' => array('subject' => 'purchases')));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<script>
var action = 'create';
</script>
<script src="<?php echo $this->_tpl_vars['module_path']; ?>
scripts/modify_purchases.js" type="text/javascript"></script>
<div id="submenu">
    <a href="/admin/module.php?m=inventory&s=purchases.php" class="on">添加采购</a>
</div>
<div id="content">
	<div class="easyui-panel" title="采购的信息" style="width:100%">
				<table style="margin:5px auto;width:100%">
					<tr>
						<td>&nbsp;&nbsp;采购单名称：<input class="easyui-textbox"  data-options="required:true" style="width:250px" id="title"></td>
						<td>
							仓库：
							<select class="easyui-combobox" style="width:110px" name="shopid"  data-options="onSelect:selectedClass">
								<?php $this->_tag_stack[] = array('shops', array()); $_block_repeat=true;smarty_block_shops($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?><option value="<?php echo $this->_tpl_vars['shops']['id']; ?>
" <?php if ($this->_tpl_vars['classes']['id'] == $_GET['classid']): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['shops']['title']; ?>
</option><?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_shops($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?>
							</select>
						</td>
						<td colspan="2">
							供货商负责人：
							<select class="easyui-combobox" style="width:110px" name="classid" id="classid" data-options="onSelect:selectedClass">
								<option value="0">不限</option>
								<?php $this->_tag_stack[] = array('classes', array()); $_block_repeat=true;smarty_block_classes($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?><option value="<?php echo $this->_tpl_vars['classes']['id']; ?>
"><?php echo $this->_tpl_vars['classes']['title']; ?>
</option><?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_classes($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?>
							</select>
						</td>
					</tr>
					<tr>
						<td  style="padding-top:10px">
							&nbsp;&nbsp;备注说明：
							<input class="easyui-textbox" name="memo" data-options="multiline:true" style="height:60px;width:250px"></input>
						</td>
						<td colspan="3">
							供货商：
							<select class="easyui-combobox" style="width:400px" name="supplierid" id="supplierid" data-options="valueField: 'id',textField: 'title',onSelect:selectedSupplier,onLoadSuccess:loadSuppliersSuccess" url="/admin/module.php?m=inventory&s=purchases.php&uri=getSupplies&classid=0">
							</select>
						</td>
					</tr>
					<tr>
						<td style="padding-top:10px">&nbsp;&nbsp;运费:<input class="easyui-textbox" style="width:150px" name="express_price"></td>
						<td>其他费:<input class="easyui-textbox" style="width:150px" name="other_price"></td>
						<td>折扣:<input class="easyui-textbox" style="width:150px" name="discount_price"></td>
						<td>实际采购总价:<input class="easyui-textbox" style="width:150px" name="purchase_price" value="0" readonly><span style="color:red;">添加完成后由系统算出</span></td>
					</tr>
				</table>
	</div>
	
	<div style="padding:2px"></div>
	
	<table id="products" class="easyui-datagrid" title="采购的商品" style="width:100%;height:80%" data-options="fitColumns:true,rownumbers:true,singleSelect:false,toolbar:toolbar">
		<thead>
			<tr>
				<th data-options="field:'selected',width:80,checkbox:true">全选</th>
				<th data-options="field:'id',width:80,align:'center',hidden:true">sku id	</th>
				<th data-options="field:'pid',width:80,align:'center'">商品id</th>
				<th data-options="field:'pic',width:80,align:'center'">商品图片</th>
				<th data-options="field:'pname',width:400,align:'center'"">商品名称</th>
				<th data-options="field:'spec',width:120,align:'center'">商品规格</th>
				<th data-options="field:'unit',width:120,align:'center',editor:'text'">产品单位</th>
				<th data-options="field:'pricebuy',width:120,align:'center',editor:'text'">采购单价</th>
				<th data-options="field:'currency_unit',width:120,align:'center'">货币单位</th>
				<th data-options="field:'number',width:120,align:'center',editor:'numberbox'">采购数量</th>
				<th data-options="field:'discount',width:120,align:'center',editor:'text'">商品采购折扣</th>
			</tr>
		</thead>
	</table>
	
	<div id="addProductsArea" class="easyui-dialog" title="选择商品" data-options="iconCls:'icon-add',closed: true,modal: true" style="width:70%;height:500px;padding:10px;">
			<input type="text" id="searchProducts" style="width:300px;height:20px;" placeholder="商品ID,多个商品中间用逗号隔开" />
			<input type="text" id="searchBarcode" style="width:300px;height:20px;" placeholder="商品条码值,多个商品中间用逗号隔开" />
			<input id="search" type="image" src="/image/admin/search.gif" onclick="javascript:doSearch();">
			<div style="margin-top:5px"></div>
			<table class="easyui-datagrid"  id="addProducts" title="商品列表" style="width:100%;height:310px;" data-options="fitColumns:true,singleSelect:false">
				<thead>
					<tr>
						<th data-options="field:'selected',width:80,checkbox:true">全选</th>
						<th data-options="field:'id',width:80,hidden:true">sku id</th>
						<th data-options="field:'pid',width:80,align:'center'">商品id</th>
						<th data-options="field:'pic',width:100,align:'center'">商品图片</th>
						<th data-options="field:'pname',width:400,align:'center'">商品名称</th>
						<th data-options="field:'spec',width:120,align:'center'">商品规格</th>
						<th data-options="field:'cost_price',width:100,align:'center'">采购价格</th>
						<th data-options="field:'currency_unit',width:100,align:'center'">货币单位</th>
					</tr>
				</thead>
			</table>
			<div style="margin-top:5px;text-align: right">
				<a href="javascript:addSelectedProducts()" class="easyui-linkbutton" data-options="iconCls:'icon-ok'">添加所选商品</a>
			</div>
	</div>

	<div class="fr mt10">
		<a href="javascript:save()" class="easyui-linkbutton" data-options="iconCls:'icon-save',width:150,height:30">保存</a>
		<a href="javascript:location.href='/admin/module.php?m=inventory&amp;s=purchases.php'" class="easyui-linkbutton" data-options="iconCls:'icon-undo',width:100">取消</a>
	</div>
</div>
<script>
	var productsData = null;	
	var paper_id = 0;
</script>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/bottom.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
</body>
</html>